package com.addplus.townmall.server.api.mapper.town;

import com.addplus.townmall.server.api.model.town.StoreCategory;
import com.addplus.townmall.server.api.model.town.expand.StoreCategoryExpand;
import com.addplus.townmall.server.api.utils.BaseAddMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 商城店铺商品自定义分类信息 Mapper 接口
 * </p>
 *
 * @author zhangjiehang
 * @since 2018-08-27
 */
public interface StoreCategoryMapper extends BaseAddMapper<StoreCategory> {

    @Select("SELECT id,parent_category_id,name  FROM store_category WHERE store_id =#{store_id} AND is_show = 1 AND is_deleted = 0 ORDER BY parent_category_id ,sort")
    List<StoreCategoryExpand> getStoreCategoryAll(@Param("store_id")Integer storeId);

}
